import http from "@/utils/request";

/**
 * 查询所有班级
 * @param params
 */
export const getClassListApi = <T, K>(params?: T) => http.get<K>("/school/class", { params });
/**
 * 查询班级
 * @param params
 */
export const getClassApi = <T>(id: number) => http.get<T>(`/school/class/${id}`);
/**
 * 新增班级
 * @param data
 */
export const addClassApi = <T>(data: T) => http.post("/school/class", data);
/**
 * 更新班级
 * @param data
 */
export const updateClassApi = <T>(id: number, data: T) => http.patch(`/school/class/${id}`, data);
/**
 * 删除班级
 * @param data
 */
export const removeClassApi = (id: number) => http.delete(`/school/class/${id}`);
/**
 * 导出班级列表
 * @param params
 */
export const exportClassListApi = <T>() => http.get<T>(`/school/class/export`);
/**
 * 新增班级课程
 * @param params
 */
export const addClassCourseApi = <T>(data: T) => http.post("/school/course", data);
/**
 * 更新班级课程
 * @param params
 */
export const updateClassCourseApi = <T>(data: T) => http.patch("/school/course", data);